

package com.hazelcast.instance.impl;

import com.hazelcast.instance.AddressPicker;
import com.hazelcast.internal.cluster.Joiner;
import com.hazelcast.internal.server.Server;
import com.hazelcast.internal.server.tcp.LocalAddressRegistry;
import com.hazelcast.internal.server.tcp.ServerSocketRegistry;

/**
 * A context for node to provide its dependencies. Acts as a dependency factory.
 * <p>
 * Normally, there is a default context. But to be able to make tests simpler,
 * to run them faster and in-parallel, it's necessary to avoid network and some heavy-weight
 * objects creations. That's why most of the tests use a special purpose NodeContext.
 */
public interface NodeContext {

    NodeExtension createNodeExtension(Node node);

    AddressPicker createAddressPicker(Node node);

    Joiner createJoiner(Node node);

    Server createServer(Node node, ServerSocketRegistry registry, LocalAddressRegistry addressRegistry);
}
